﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Unity;
using WorkerManagement.WorkerList;

namespace WorkerManagement
{
    public class WorkerManagementModule : IModule
    {
        private IUnityContainer Container { get; set; }

        public WorkerManagementModule(IUnityContainer container)
        {
            this.Container = container;
        }

        public void Initialize()
        {
            RegisterTypes();

            this.Container.Resolve<ModuleController>().Run();
        }

        private void RegisterTypes()
        {
            this.Container.RegisterType<IWorkerListView, WorkerListView>();
            this.Container.RegisterType<IWorkerListPresentationModel, WorkerListPresentationModel>();
        }
    }
}
